Skip to content

State the surface of the service route by route - #87

Merged
estebanzimanyi merged 1 commit into
masterfrom
test/surface-route-by-route
Nov 19, 2026
Merged

estebanzimanyi merged 1 commit into
masterfrom
test/surface-route-by-route

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

api/surface.json is the surface of the service: for every operation the
route table holds, its method and path, the conformance class it is a
requirement of or that it is an extension, and the functions MobilityDB
declares that its handler applies. A server has no object layer for a
binding's matrix to read, so the service states its surface itself.

ats_surface_test.go writes it and holds it to the code. The functions of a
route are read from the source: every SQL call in a string literal its
handler reaches, through the package functions and variables it names
(tProps among them, whose expressions the query route applies), kept to the
names the generated tables state MobilityDB declares. The route table and the
router name every handler and answer nothing, so the walk does not enter
them. A handler is the innermost named function of its runtime name, since
Go names the closure edrQuery returns, inlined into routeTable,
routeTable.edrQuery.func1. go test -run TestSurfaceIsWhatTheServiceApplies
-update-surface rewrites the file.

Measured. go test passes; the 45 routes reach the functions their handlers
apply (the TemporalGeometrySequence asMFJSON over sequenceN, the query route
interp, cumulativeLength and speed, the coverage rasterUnion, each EDR query
asCoverageJSON), the health check none; a surface with one function removed
fails the test.

api/surface.json is the surface of the service: for every operation the
route table holds, its method and path, the conformance class it is a
requirement of or that it is an extension, and the functions MobilityDB
declares that its handler applies. A server has no object layer for a
binding's matrix to read, so the service states its surface itself.

ats_surface_test.go writes it and holds it to the code. The functions of a
route are read from the source: every SQL call in a string literal its
handler reaches, through the package functions and variables it names
(tProps among them, whose expressions the query route applies), kept to the
names the generated tables state MobilityDB declares. The route table and the
router name every handler and answer nothing, so the walk does not enter
them. A handler is the innermost named function of its runtime name, since
Go names the closure edrQuery returns, inlined into routeTable,
routeTable.edrQuery.func1. go test -run TestSurfaceIsWhatTheServiceApplies
-update-surface rewrites the file.

Measured. go test passes; the 45 routes reach the functions their handlers
apply (the TemporalGeometrySequence asMFJSON over sequenceN, the query route
interp, cumulativeLength and speed, the coverage rasterUnion, each EDR query
asCoverageJSON), the health check none; a surface with one function removed
fails the test.
@estebanzimanyi
estebanzimanyi merged commit 0f03c16 into master Nov 19, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the test/surface-route-by-route branch November 19, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant